﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Tong;
public partial class js组件_js拖拽_NewsList : System.Web.UI.Page
{
    /// <summary>
    /// 数据操作通用类 实例 TextData
    /// </summary> 
    public TongUse TextData = new TongUse();

    /// <summary>
    /// 系统安装绝对路径
    /// </summary>
    public string Abs_Path = TongUse.SysPath;
    /// <summary>
    /// 用户存放数据的临时表
    /// </summary>
    DataTable MyDt = new DataTable();

    /// <summary>
    ///分页
    /// </summary>
    Tong.Fy.FenYe FY = new Tong.Fy.FenYe();
    public int contpages = 0;

    /// <summary>
    /// 显示问题的类型
    /// </summary>
    public string Type = "n";//n 最新 ,z 0回答问题 ,u 新手 , f 高分

    

    public string CoulmnID = "";//栏目ID
    protected void Page_Load(object sender, EventArgs e)
    {
        string sql = "";

        try//得到类型
        {
            Type = Request.QueryString["Type"].Trim();
            CoulmnID = Request.QueryString["status"].Trim();//栏目ID
        }
        catch
        {

        }

        if (CoulmnID != "")
        {
            #region 输出不同的SQL
            if (Type == "n")//n 最新
            {
                sql = "select * from [CX_News] where [CX_NEWS_Class_id] =  (SELECT [CX_NEWS_Class_id] FROM [CX_NEWS_Class] where [CX_Column_id]=" + CoulmnID + ")";
            }

            #endregion

            try
            {
                contpages = int.Parse(TextData.SqlataSet(sql).Tables[0].Rows.Count.ToString());
            }
            catch
            {

            }
        }


        Repeater1.DataSource = FY.Fy(sql, 2);//分页
        Repeater1.DataBind();
        Response.ContentType = "text/xml";

    }
}
